package com.googlecode.icaltohtml;

import java.io.PrintWriter;
import java.util.Calendar;
import java.util.List;

public class EventItem extends Item {

	private Calendar dateStamp, dateStart, dateEnd;
	private String summary, description, organizer, status;
	private long duration;
	private List<String> categories;
	
	public EventItem(){
		super();
	}
		
	
	@Override
	public void printXML(PrintWriter out) {
		out.println("\t\t<event>");

		if(dateStamp!=null)
			out.println("\t\t\t<dtstamp>"+SDF.format(dateStamp.getTime())+"</dtstamp>");
		else		
			out.println("\t\t\t<dtstamp>null</dtstamp>");
		
		if(dateEnd!=null)
			out.println("\t\t\t<dend>"+SDF.format(dateEnd.getTime())+"</dend>");
		else		
			out.println("\t\t\t<duration>"+duration+"</duration>");
		
		if(dateStart!=null)
			out.println("\t\t\t<dstart>"+SDF.format(dateStart.getTime())+"</dstart>");
		else		
			out.println("\t\t\t<dstart>null</dstart>");	
		
		out.println("\t\t\t<organizer>"+organizer+"</organizer>");
		out.println("\t\t\t<summary>"+summary+"</summary>");
		out.println("\t\t\t<description>"+description+"</description>");
		out.println("\t\t\t<status>"+status+"</status>");
				
		out.println("\t\t\t<categories>");
		if(categories!=null)
			for(String cat: categories)				
				out.println("\t\t\t\t<category>"+cat+"</category>");
		out.println("\t\t\t</categories>");
		
		out.println("\t\t\t<summary>"+summary+"</summary>");
		out.println("\t\t</event>");
	}



	public Calendar getDateStamp() {
		return dateStamp;
	}



	public void setDateStamp(Calendar dateStamp) {
		this.dateStamp = dateStamp;
	}



	public Calendar getDateStart() {
		return dateStart;
	}



	public void setDateStart(Calendar dateStart) {
		this.dateStart = dateStart;
	}



	public Calendar getDateEnd() {
		return dateEnd;
	}



	public void setDateEnd(Calendar dateEnd) {
		this.dateEnd = dateEnd;
	}



	public String getSummary() {
		return summary;
	}



	public void setSummary(String summary) {
		this.summary = summary;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public String getOrganizer() {
		return organizer;
	}


	public void setOrganizer(String organizer) {
		this.organizer = organizer;
	}


	public String getStatus() {
		return status;
	}


	public void setStatus(String status) {
		this.status = status;
	}


	public long getDuration() {
		return duration;
	}


	public void setDuration(long duration) {
		this.duration = duration;
	}


	public List<String> getCategories() {
		return categories;
	}


	public void setCategories(List<String> categories) {
		this.categories = categories;
	}

}
